<template>
    <CostForm :conditionForm="conditionForm" :addition-rules="rules" form-name="update" @change-props="changeProps">
        <template v-slot:addtionItem>
            <el-form-item label="成本更新差异科目" prop="costVarianceAccount">
                <el-input v-model="conditionForm.costVarianceAccount"></el-input>
            </el-form-item>
            <el-form-item label="物料编码" prop="materielCode">
                <el-input v-model="conditionForm.materielCode"></el-input>
            </el-form-item>
        </template>
    </CostForm>
</template>
<script lang="ts" setup>
import CostForm from '@/components/material-cost/CostForm.vue'
import { ref } from 'vue';

const conditionForm = ref({
    organizationCode: "",
    costTypeId: "",
    costVarianceAccount: "",
    materielCode: ""
})
const rules = ref({
    costVarianceAccount: [
        { required: true, message: '请输入成本更新差异科目', trigger: 'blur' },
    ]
})
const changeProps = (data: any) => {
    conditionForm.value.costTypeId = data.costTypeId.split(',')[0];
}
</script>
<style lang="scss" scoped></style>
